package com.zelix;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ItemListener;
import java.awt.event.ItemEvent;
import java.util.Vector;
import java.util.Enumeration;
import java.util.ArrayList;
import java.io.BufferedReader;
import java.io.StringReader;


public abstract class h2 extends g2
        implements jo, ItemListener {

    static String d = z(z("Vc\"r3E63j;R\177#>7G\177.60G`!06Gx'0\tRd)p=}Ki"));
    Frame e;
    vc f;
    Vector g;
    yw h;
    JComboBox i;
    DefaultComboBoxModel j;
    DefaultComboBoxModel k;
    JComboBox l;
    jy m;
    jy n;
    jy o;
    jy p;
    boolean q;
    boolean r;
    private String s;
    private boolean t;
    JButton u;
    JButton v;
    JButton w;
    k4 x;
    JButton y;
    JButton z;
    JButton A;
    u3 B;
    private DefaultListModel C;
    jy D;
    JTextArea E;
    nh F;
    int G;
    int H;
    boolean I;
    private static String J[];

    h2(String s1, Frame frame, Vector vector, vc vc1, nh nh, yw yw1, int i1) {
        x = new k4(true);
        f = vc1;
        g = vector;
        e = frame;
        h = yw1;
        F = nh;
        H = i1;
    }

    static DefaultListModel a(h2 h2_1) {
        return h2_1.C;
    }

    static boolean b(h2 h2_1) {
        return h2_1.t;
    }

    final void f() {
        kv kv1 = new kv(this);
        a(kv1);
    }

    abstract void a(yw yw1);

    private void a(jy jy1) {
        int i1;
        if (!B.isSelectionEmpty())
            s = B.getSelectedValue().toString();
        for (i1 = 0; i1 < jy1.size(); i1++) {
            String s1 = (String) jy1.a(i1);
            if (D.containsKey(s1)) {
                bz bz1 = (bz) D.remove(s1);
                t = true;
                C.removeElement(bz1);
                t = false;
            }
        }
        String s1 = (String) jy1.a(i1);
        if (D.containsKey(s1)) {
            bz bz1 = (bz) D.remove(s1);
            t = true;
            C.removeElement(bz1);
            t = false;
        }

        if (B.getSelectedIndex() == -1)

        {
            z.setEnabled(false);
            A.setEnabled(false);
            E.setText("");
        }

        return;
    }

    private void b(jy jy1) {
        int i1;
        i1 = 0;
        for (; i1 < jy1.size(); i1++) {
            String s1 = (String) jy1.a(i1);
            if (!D.containsKey(s1)) {
                cz cz1 = new cz(s1, false);
                D.put(s1, cz1);
                C.addElement(cz1);
            }
        }

        if (i1 >= jy1.size()) {
            if (B.getSelectedIndex() == -1 && s != null && D.containsKey(s))
                B.setSelectedIndex(D.a(s));
            s = null;
            if (C.size() > 0)
                B.ensureIndexIsVisible(C.size() - 1);
        }
    }

    private void g() {
        gj gj1;
        m = new jy();
        if (H == 1) {
            gj1 = dd.a(F);
        } else
            gj1 = ed.a(F);

        if (gj1 == null) {//goto _L2;else goto _L1
            Enumeration enumeration = gj1.i();
            while (enumeration.hasMoreElements()) {
//        if (!flag)goto _L4;else goto _L3
//        _L3:
                il il1 = (il) enumeration.nextElement();
                jt jt1 = new jt(il1);
                String s1 = jt1.toString();
                m.put(s1, jt1);
            }
//        _L4:
//        if (enumeration.hasMoreElements())goto _L3;else goto _L2
//        _L2:
        }
        n = new jy();
        if (H == 1) {
            gj1 = dd.c(F);
        } else
            gj1 = ed.c(F);

        Enumeration enumeration;
        if (gj1 != null) {//goto _L6;else goto _L5
//        _L5:
            enumeration = gj1.i();
//        if (!flag)goto _L8;else goto _L7
//        _L7:
            while (enumeration.hasMoreElements()) {
                il il2 = (il) enumeration.nextElement();
                jt jt2 = new jt(il2);
                String s2 = jt2.toString();
                n.put(s2, jt2);
            }
//        _L8:
//        if (enumeration.hasMoreElements())goto _L7;else goto _L6

        }
//        _L6:
//        label2:
//        {
        o = new jy();
        if (H == 1) {
            gj1 = dd.b(F);
        } else
            gj1 = ed.b(F);
//        }
        if (gj1 != null) {//goto _L10;else goto _L9
//        _L9:
            enumeration = gj1.i();
//        if (!flag)goto _L12;else goto _L11
//        _L11:
            while (enumeration.hasMoreElements()) {
                il il3 = (il) enumeration.nextElement();
                jt jt3 = new jt(il3);
                String s3 = jt3.toString();
                o.put(s3, jt3);
            }
//        _L12:
//        if (enumeration.hasMoreElements())goto _L11;else goto _L10
        }
//        _L10:
//        label3:
//        {
        p = new jy();
        if (H == 1) {
            gj1 = dd.d(F);
        } else
            gj1 = ed.d(F);
//        }
        if (gj1 != null) {//goto _L14;else goto _L13
//        _L13:
            enumeration = gj1.i();
//        if (!flag)goto _L16;else goto _L15
//        _L15:
            while (enumeration.hasMoreElements()) {
                il il4 = (il) enumeration.nextElement();
                jt jt4 = new jt(il4);
                String s4 = jt4.toString();
                p.put(s4, jt4);
            }
//        _L16:
//        if (enumeration.hasMoreElements())goto _L15;else goto _L14
//        _L14:
        }
    }

    final void h() {
        I = true;
        a();
        h.a();
    }

    void i() {
        int i1;
        boolean flag;
        int j1;
        i1 = C.getSize();
        if (o.size() <= i1) {
//            break MISSING_BLOCK_LABEL_77;
            flag = true;
            for (j1 = 0; j1 < o.size(); j1++) {
//        if (!flag1)goto _L2;else goto _L1
//        _L1:
                if (!D.containsKey(o.a(j1))) {
//            continue; /* Loop/switch isn't completed */
                    flag = false;
//        if (!flag1)
//            break MISSING_BLOCK_LABEL_79;
                }
            }
        } else
//        j1++;
//        _L2:
//        if (j1 < o.size())goto _L1;else goto _L3
//        _L3:
//        if (!flag1)
//            break MISSING_BLOCK_LABEL_79;

            flag = false;

        if (flag) {
            q = true;
            i.setSelectedIndex(1);
            f.a(1);
            q = false;
            return;
        }
        if (n.size() <= i1) {
//            break MISSING_BLOCK_LABEL_174;
            flag = true;
            for (j1 = 0; j1 < n.size(); j1++) {
//        if (!flag1)goto _L5;else goto _L4
//        _L4:
                if (!D.containsKey(n.a(j1))) {
//            continue; /* Loop/switch isn't completed */
                    flag = false;
                }
//        if (!flag1)
//            break MISSING_BLOCK_LABEL_176;
            }
        } else
            flag = false;

//        j1++;
//        _L5:
//        if (j1 < n.size())goto _L4;else goto _L6
//        _L6:
//        if (!flag1)
//            break MISSING_BLOCK_LABEL_176;
        if (flag) {
            q = true;
            i.setSelectedIndex(0);
            f.a(0);
            q = false;
            return;
        }
        if (p.size() <= i1) {
//            break MISSING_BLOCK_LABEL_271;
            flag = true;
            for (j1 = 0; j1 < p.size(); j1++) {
//        if (!flag1)goto _L8;else goto _L7
//        _L7:
                if (!D.containsKey(p.a(j1))) {
                    flag = false;
                }
//        if (!flag1)
//            break MISSING_BLOCK_LABEL_273;
            }
        } else
            flag = false;

//        j1++;
//        _L8:
//        if (j1 < p.size())goto _L7;else goto _L9
//        _L9:
//        if (!flag1)
//            break MISSING_BLOCK_LABEL_273;
        if (flag) {
            q = true;
            i.setSelectedIndex(2);
            f.a(2);
            q = false;
        } else {
            q = true;
            i.setSelectedIndex(3);
            f.a(3);
            q = false;
        }
    }

    final void j() {
        if (r || l == null)
            return;
        switch (l.getSelectedIndex()) {
            default:
                if (!D.containsKey(a((bp) l.getSelectedItem())))
                    l.setSelectedIndex(0);
                break;

            case -1:
            case 0: // '\0'
                break;
        }
    }

    public final void a() {
        super.a();
        if (!I)
            h.a();
    }

    final void k() {
        int i1 = B.getSelectedIndex();
        a(i1);
    }

    private void a(int i1) {
            if (i1 > -1){
            t = true;
            C.remove(i1);
            t = false;
            D.b(i1);
            int j1 = C.getSize();
            if (i1 < j1) {
                B.setSelectedIndex(i1);
            }else
            if (j1 > 0)
                B.setSelectedIndex(j1 - 1);
            }
            int k1;
                k1 = B.getSelectedIndex();
                if (k1 == -1) {
                    z.setEnabled(false);
                    A.setEnabled(false);
                    E.setText("");
                }else{
                cz cz1 = (cz) B.getSelectedValue();
                if (cz1.b()) {
                    z.setEnabled(false);
                    A.setEnabled(false);
                }else{
                z.setEnabled(true);
                A.setEnabled(true);
                }
            String s1 = (String) ((bz) C.getElementAt(k1)).a();
            String s2 = d(s1).a(H == 1);
            E.setText(s2);
            E.setCaretPosition(0);
                }
        q();
    }

    final void b(String s1) {
        a(D.a(s1));
    }

    abstract void a(j0 j0_1, Container container);

    abstract void b(j0 j0_1, Container container);

    abstract void a(Object obj, String s1, yw yw1);

    public Action d() {
        return new h1(this);
    }

    abstract String[] l();

    int c(String s1) {
        int i1;
        int j1;
//        boolean flag;
//        flag = tb.b;
        i1 = k.getSize();
        for (j1 = 1; j1 < i1; j1++) {
//        if (!flag)goto _L2;else goto _L1
//        _L1:
            bp bp1 = (bp) k.getElementAt(j1);
            if (bp1.b().l().equals(s1))
                return j1;
        }
//        j1++;
//        _L2:
//        if (j1 >= i1)
        return -1;
//        if (true)goto _L1;else goto _L3
//        _L3:
    }

    abstract String a(bp bp1);

    abstract String a(String s1, boolean flag);

    abstract String[] m();

    boolean n() {
        return true;
    }

    public void itemStateChanged(ItemEvent itemevent) {
        if (itemevent.getSource() == i) {
            if (q)
                return;
            int i1 = j.getIndexOf(itemevent.getItem());
            if (itemevent.getStateChange() == 1)
                f.a(i1);
            switch (i1) {
                case 3: // '\003'
                default:
                    break;

                case 1: // '\001'
                    if (itemevent.getStateChange() == 1) {
                        b(o);
                        i();
                    } else
                        a(o);
                    break;
// fall through

                case 0: // '\0'
                    if (itemevent.getStateChange() == 1) {
                        b(n);
                        i();
                    } else
                        a(n);
                    break;
// fall through

                case 2: // '\002'
                    if (itemevent.getStateChange() == 1) {
                        b(p);
                        i();
                    } else {
                        a(p);
                    }
            }
        } else if (itemevent.getSource() == l) {
            if (r)
                return;
            int j1 = k.getIndexOf(itemevent.getItem());
            switch (j1) {
                default:
                    String s1 = a((bp) k.getElementAt(j1));
                    if (itemevent.getStateChange() == 1) {
                        b(s1);
                    } else {
                        r = true;
                        b(s1);
                        r = false;
                    }
                    break;

                case -1:
                case 0: // '\0'
                    break;
            }
        }
    }

    final void o() {
        G = B.getSelectedIndex();
        if (G != -1) {
            String s1 = (String) ((bz) B.getSelectedValue()).a();
            jt jt1 = d(s1);
            mv mv1 = new mv(this);
            a(jt1, s1, mv1);
        }
    }

    abstract void a(jt jt1, String s1, yw yw1);

    final void a(Object obj) {
        String s1 = obj.toString();
        cz cz1 = new cz(s1, false);
        C.setElementAt(cz1, G);
        if (D.containsKey(s1) && D.a(s1) != G) {
            t = true;
            C.remove(G);
            t = false;
            D.b(G);
            B.setSelectedIndex(C.indexOf(cz1));
        } else {
            D.a(G, s1, cz1);
            String s2 = d(s1).a(H == 1);
            E.setText(s2);
            E.setCaretPosition(0);
        }
    }

    final void b(Object obj) {
        a(obj, false);
    }

    final void a(Object obj, boolean flag) {
//        label0:
//        {
        String s1 = obj.toString();
        if (!D.containsKey(s1)) {
//                break label0;
            cz cz1 = new cz(s1, flag);
            C.addElement(cz1);
            D.put(s1, cz1);
            B.setSelectedIndex(C.indexOf(cz1));
            if (B.getSelectedIndex() == -1) {
                z.setEnabled(false);
                A.setEnabled(false);
                E.setText("");
//                if (!tb.b)
//                    break label0;
            } else
                B.ensureIndexIsVisible(B.getSelectedIndex());
        }
//        }
    }

    final void p() {
        if (n()) {
            I = true;
            a();
            s();
            h.a(new Integer(1));
        }
    }

    void q() {
        i();
        j();
    }

    final jt d(String s1) {
        BufferedReader bufferedreader = new BufferedReader(new StringReader(s1 + ";"));
        oh oh1 = new oh(bufferedreader);
        vh vh1 = null;
        try {
            vh1 = oh1.Gb();
            vh1.a(null, F);
        }
        catch (pb pb1) {
        }
        catch (mb mb1) {
        }
        return new jt(((oj) vh1).j());
    }

    final void r() {
        Cursor cursor = Cursor.getDefaultCursor();
        setCursor(cursor);
        E.setCursor(cursor);
    }

    void s() {
        ArrayList arraylist;
        Enumeration enumeration;
        arraylist = new ArrayList();
        enumeration = C.elements();
//        if (!flag)goto _L2;else goto _L1
//        _L1:
        while (enumeration.hasMoreElements()) {
            cz cz1 = (cz) enumeration.nextElement();
            if (!cz1.b())
                arraylist.add(cz1.a());
        }
//        _L2:
//        if (enumeration.hasMoreElements())goto _L1;else goto _L3
//        _L3:
        f.a(arraylist);
        int index = l.getSelectedIndex();
        switch (index) {
            case 0:
            case -1:
                f.a(false, null, false);
                break;
            default:
                bp bp1 = (bp) l.getSelectedItem();
                f.a(true, bp1.c(), bp1.a());
                break;
        }
    }

    final void a(Container container) {
        o4 o4_1;
        j0 j0_1;
        Enumeration enumeration;
//        boolean flag;
//        flag = tb.b;
        g();
        o4_1 = new o4(false, true);
        j0_1 = new j0(o4_1);
        o4_1.setLayout(j0_1);
        o4_1.add(new JLabel(J[13]), J[12]);
        j = new DefaultComboBoxModel();
        i = new JComboBox(j);
        i.addItem(J[18]);
        i.addItem(J[16]);
        i.addItem(J[15]);
        i.addItem(J[14]);
        o4_1.add(i, J[17]);
        i.setToolTipText(to.b(to.fc));
        enumeration = m.d();
        while (enumeration.hasMoreElements()) {
//        if (!flag)goto _L2;else goto _L1
//        _L1:
            a((String) enumeration.nextElement(), true);
        }
//        _L2:
//        if (enumeration.hasMoreElements())goto _L1;else goto _L3
//        _L3:
        if (f.g()) {//}goto _L5;else goto _L4
//        _L4:
            Enumeration enumeration1 = f.b();
            while (enumeration1.hasMoreElements()) {
//        if (!flag)goto _L7;else goto _L6
//        _L6:
                b((String) enumeration1.nextElement());
            }
//        _L7:
//        if (enumeration1.hasMoreElements())goto _L6;else goto _L5
        }
//        _L5:
        i();
        i.addItemListener(this);
        a(j0_1, o4_1);
        j0_1.a(l());
        container.add(o4_1, J[19]);
//        return;
    }

    final void a(Container container, String s1, String s2) {
        JLabel jlabel = new JLabel(s1);
        container.add(jlabel, J[11]);
        k = new DefaultComboBoxModel();
        l = new JComboBox(k);
        container.add(l, J[10]);
        l.addItem(J[9]);
        if (g == null || g.size() == 0) {//}goto _L2;else goto _L1
            l.setEnabled(false);
        } else {
            for (int i1 = 0; i1 < g.size(); i1++) {
                l.addItem(g.elementAt(i1));
            }
        }

        if (f.f() && f.g()) {
            String s3 = f.e();
            int j1 = c(s3);
            if (j1 > -1) {
                l.setSelectedIndex(j1);
            } else
                b(a(s3, f.a()));
        }
        l.addItemListener(this);
        l.setToolTipText(s2);
    }

    final void t() {
        j0 j0_1 = new j0(x);
        x.setLayout(j0_1);
        y = new JButton(J[4]);
        y.setToolTipText(to.b(to.bb));
        z = new JButton(J[7]);
        z.setToolTipText(to.b(to.cb));
        A = new JButton(J[6]);
        A.setToolTipText(to.b(to.db));
        C = new DefaultListModel();
        B = new u3(C);
        B.setSelectionMode(0);
        B.setFont(getFont());
        B.setToolTipText(to.b(to.eb));
        D = new jy();
        E = new JTextArea();
        E.setEditable(false);
        E.setToolTipText(to.b(to.gb));
        x.add(y, J[2]);
        x.add(z, J[1]);
        x.add(A, J[5]);
        x.add(new q4(B), J[0]);
        x.add(new q4(E), J[3]);
        j0_1.a(m());
        z.setEnabled(false);
        A.setEnabled(false);
        tc tc1 = new tc(this);
        B.addListSelectionListener(tc1);
        uc uc1 = new uc(this);
        y.addActionListener(uc1);
        z.addActionListener(uc1);
        A.addActionListener(uc1);
        B.addMouseListener(new u(this));
        d d1 = new d(this);
        y.addKeyListener(d1);
        z.addKeyListener(d1);
        A.addKeyListener(d1);
        B.addKeyListener(d1);
    }

    void u() {
        Cursor cursor = new Cursor(3);
        setCursor(cursor);
        E.setCursor(cursor);
    }

    public final void e(String s1) {
        setTitle(s1);
        Container container = getContentPane();
        j0 j0_1 = new j0(container);
        container.setLayout(j0_1);
        y y1 = new y(this);
        addWindowListener(y1);
        container.add(x, J[8]);
        t();
        a(container);
        b(j0_1, container);
        Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
        setIconImage(zo.a(this));
        setSize(Math.min(600, dimension.width), Math.min(500, dimension.height));
        Dimension dimension1 = getSize();
        Point point = e.getLocationOnScreen();
        Dimension dimension2 = e.getSize();
        int i1 = (dimension2.width / 2 - dimension1.width / 2) + point.x;
        int j1 = (dimension2.height / 2 - dimension1.height / 2) + point.y;
        i1 = Math.max(0, i1);
        j1 = Math.max(0, j1);
        setLocation(i1, j1);
        e.setEnabled(false);
        zz.a(this, true);
    }

    private static char[] z(String str) {
        char ac[] = str.toCharArray();
        int clen = ac.length;
        if (clen >= 2)
            return ac;
        ac[0] ^= 0x5a;
        return ac;
    }

    private static String z(char[] chs) {
        for (int i = 0; i < chs.length; i++) {
            byte key = 0;
            switch (i % 5) {
                case 0:
                    key = 0x26;
                    break;
                case 1:
                    key = 22;
                    break;
                case 2:
                    key = 64;
                    break;
                case 3:
                    key = 30;
                    break;
                default:
                    key = 90;
                    break;
            }
            chs[i] ^= key;
        }
        return new String(chs).intern();
    }

    static {
        String as[] = new String[20];
        as[0] = z(z("Kw)p\nGd!s\026Oe4"));
        as[1] = z(z("Kw)p\027Ir)x#db."));
        as[2] = z(z("Kw)p\033Br\002j4"));
        as[3] = z(z("Cn0r;Hw4w5HW2{;"));
        as[4] = z(z("gr$"));
        as[5] = z(z("Kw)p\036Cz%j?db."));
        as[6] = z(z("bs,{.C"));
        as[7] = z(z("ky$w<_"));
        as[8] = z(z("Kw)p\nHz"));
        as[9] = z(z("\032X/p?\030"));
        as[10] = z(z("Kw)p\031Jw3m\031I{\"q\030In"));
        as[11] = z(z("Cn#r/Bs\r\1773HU,\177)UZ\"r"));
        as[12] = z(z("Gf0r3Ew4w5HB9n?jt,"));
        as[13] = z(z("gf0r3Ew4w5H64g*C,"));
        as[14] = z(z("us,xzEy.j;Ox%zzGf0r3Ew4w5H6/lzGf0r?R"));
        as[15] = z(z("l$\r[zk_\004r?R"));
        as[16] = z(z("cn4{4U\177\"r?\006p2\1777Ca/l1"));
        as[17] = z(z("Gf0r3Ew4w5HB9n?ey-|5dy8"));
        as[18] = z(z("hy.3?^b%p)Ot,{zEz!m)\006z)|(Gd9"));
        as[19] = z(z("Cn4l;vx,"));
        J = as;
    }
}